package cn.itcast.bos.service.base.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.itcast.bos.dao.base.AreaRepository;
import cn.itcast.bos.domain.base.Area;
import cn.itcast.bos.service.base.AreaService;

/**
 * 区域的业务实现类
 * 
 * @author 王文杰
 * @version 1.0, 2017-9-5 08:45:42
 */
@Service
@Transactional
public class AreaServiceImpl implements AreaService {

	/** 注入dao */
	@Autowired
	private AreaRepository areaRepository;
	
	/**
	 * @see cn.itcast.bos.service.base.AreaService#saveBatch(List)
	 */
	@Override
	public void saveBatch(List<Area> areas) {
		
		areaRepository.save(areas);
	}

	/**
	 * @see cn.itcast.bos.service.base.AreaService#findPageData(Specification, Pageable)
	 */
	@Override
	public Page<Area> findPageData(Specification<Area> specification, Pageable pageable) {
	
		return areaRepository.findAll(specification, pageable);
	}

	/**
	 * @see cn.itcast.bos.service.base.AreaService#findAll()
	 */
	@Override
	public List<Area> findAll() {

		return areaRepository.findAll();
	}

}
